<?php

use think\migration\Seeder;

class ManageAccount extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run():void
    {
        $table = 'manage_account';
        $salt = createSalt();
        $singleRow = [
            'username' => 'root',
            'nickname' => '超级管理员',
            'salt' => $salt,
            'password' => encryptPassword('abc123', $salt, 0),
            'level' => 1
        ];
        $this->table($table)->insert($singleRow)->save();
    }
}